'use strict';
// Copyright 2014 Blueant Inc. All Rights Reserved.

/**
 * @fileoverview 掠夺
 * @author sundbcn@gmail.com (sun debing)
 */

var async = require('async');
var Code = require('../../../consts/code');
var harryEnter = require('./harry/enter');
var harryExit = require('./harry/exit');
var harryLucky = require('./harry/lucky');
var harryRelucky = require('./harry/relucky');
var harrySalary = require('./harry/receiveSalary');
var harryShop = require('./harry/buyShop');
var harryRivalInfo = require('./harry/rivalInfo');
var harryGetRivalList = require('./harry/getRivalList');
var harryChangeRival = require('./harry/changeRival');
var harryEnterGuide = require('./harry/enterGuide');
var harryExitGuide = require('./harry/exitGuide');
var harryRivalGuide = require('./harry/rivalGuide');
var harryIncFullProsperousByDiamond = require('./harry/incFullProsperousByDiamond');
var harryOpenHonorBox = require('./harry/openHonorBox.js');
var harryClearHonorBoxTime = require('./harry/clearHonorBoxTime.js');

module.exports = function (app) {
    return new Handler(app);
};

var Handler = function (app) {
    this.app = app;
};

/**
 * 进入战斗
 * @param  {[type]}   msg     [description]
 * @param  {[type]}   session [description]
 * @param  {Function} next    [description]
 * @return {[type]}           [description]
 */
Handler.prototype.enter = function (msg, session, next) {
    harryEnter(msg, session, next);
};

/**
 * 离开战斗
 * @param  {[type]}   msg     [description]
 * @param  {[type]}   session [description]
 * @param  {Function} next    [description]
 * @return {[type]}           [description]
 */
Handler.prototype.exit = function (msg, session, next) {
    harryExit(msg, session, next);
};

/**
 * 抽取奖励
 * @param  {[type]}   msg     [description]
 * @param  {[type]}   session [description]
 * @param  {Function} next    [description]
 * @return {[type]}           [description]
 */
Handler.prototype.lucky = function (msg, session, next) {
    harryLucky(msg, session, next);
};

/**
 * 重新抽奖
 * @param  {[type]}   msg     [description]
 * @param  {[type]}   session [description]
 * @param  {Function} next    [description]
 * @return {[type]}           [description]
 */
Handler.prototype.relucky = function (msg, session, next) {
    harryRelucky(msg, session, next);
};

/**
 * 每日俸禄
 * @param  {[type]}   msg     [description]
 * @param  {[type]}   session [description]
 * @param  {Function} next    [description]
 * @return {[type]}           [description]
 */
Handler.prototype.salary = function (msg, session, next) {
    harrySalary(msg, session, next);
};

/**
 * 官阶商店
 * @param  {[type]}   msg     [description]
 * @param  {[type]}   session [description]
 * @param  {Function} next    [description]
 * @return {[type]}           [description]
 */
Handler.prototype.buyShop = function (msg, session, next) {
    harryShop(msg, session, next);
};

/**
 * 对手信息
 * @param  {[type]}   msg     [description]
 * @param  {[type]}   session [description]
 * @param  {Function} next    [description]
 * @return {[type]}           [description]
 */
Handler.prototype.rivalInfo = function (msg, session, next) {
    harryRivalInfo(msg, session, next);
};

/**
 * 更换对手
 */
Handler.prototype.changeRival = function (msg, session, next) {
    harryChangeRival(msg, session, next);
};

/**
 * 新手战斗
 */
Handler.prototype.enterGuide = function (msg, session, next) {
    harryEnterGuide(msg, session, next);
};

/**
 * 退出新手战斗
 */
Handler.prototype.exitGuide = function (msg, session, next) {
    harryExitGuide(msg, session, next);
};

/**
 * 新手引导对手信息
 */
Handler.prototype.rivalGuide = function (msg, session, next) {
    harryRivalGuide(msg, session, next);
};

/**
 * 查询对手列表
 */
Handler.prototype.getRivalList = function (msg, session, next) {
    msg.get_black_list = false;
    harryGetRivalList(msg, session, next);
};

/**
 * 查询黑名单列表
 */
Handler.prototype.getBlackList = function (msg, session, next) {
    msg.get_black_list = true;
    harryGetRivalList(msg, session, next);
};

/**
 * 钻石一键升满繁荣度
 */
Handler.prototype.incFullProsperousByDiamond = function (msg, session, next) {
    harryIncFullProsperousByDiamond(msg, session, next);
};

/**
 * 开启军功宝箱
 */
Handler.prototype.openHonorBox = function (msg, session, next) {
    harryOpenHonorBox(msg, session, next);
};

/**
 * 清除军功宝箱CD
 */
Handler.prototype.clearHonorBoxTime = function (msg, session, next) {
    harryClearHonorBoxTime(msg, session, next);
};
